#{extends 'main.html' /}
#{set title:r.name + ' | Find Food' /}

<h2>View Listing: ${r.name}</h2>
<a href="@{Find.view()}">Back to Search</a>
<p class="improve-message">
	Please help us improve the accuracy of this information.<br/>Your changes
	may not be reflected by the site immediately.
</p>
<div class="restaurant-info">
	#{form @Listing.edit(r.docid) }
		<p>
			<label for="category">Category:</label>
			<select name="category" id="category">
				<option value=""></option>
				#{list items:categories, as:'category' }
					#{if category == r.categoryObject }
						<option value="${category.value}" selected="selected">${category.name}</option>
					#{/if}
					#{else}
						<option value="${category.value}">${category.name}</option>
					#{/else}
				#{/list}
			</select>
		</p>
		<p>
			<label for="address">Address:</label>
			<input type="text" name="address" id="address" value="${r.address}" size="40" maxlength="128" />
		</p>
		<p>
			<label for="city">City:</label>
			<input type="text" name="city" id="city" value="${r.city}" size="40" maxlength="128" />
		</p>
		<p>
			<label for="state">State:</label>
			<select name="state" id="state">
				<option value=""></option>
				#{list items:states, as:'state' }
					#{if state.code == r.state }
						<option value="${state.code}" selected="selected">${state.name}</option>
					#{/if}
					#{else}
						<option value="${state.code}">${state.name}</option>
					#{/else}
				#{/list}
			</select>
		</p>
		<p>
			<label for="postcode">Zip Code:</label>
			<input type="text" name="zipcode" id="zipcode" value="${r.postcode}" size="5" maxlength="5" />
		</p>
		<p>
			<label for="website">Website:</label>
			<input type="text" name="website" id="website" value="${r.website}" size="40" maxlength="128" />
			<br/><a class="website-link" href="${r.website}" rel="nofollow">${r.website}</a>
		</p>
		<p>
			<label for="telephone">Phone:</label>
			<input type="text" name="telephone" id="telephone" value="${r.telephone}" size="14" maxlength="32" />
		</p>
		<p>
			<label for="fax">Fax:</label>
			<input type="text" name="fax" id="fax" value="${r.fax}" size="14" maxlength="32" />
		</p>
		<p>
			<label></label>
			<input type="submit" value="Save" class="button" />
			<input type="reset" value="Reset" class="button reset" />
		</p>
		<input type="hidden" name="docid" value="${r.docid}" />
	#{/form}
</div>